from simcell.cell.cytosol import Cytosol
from simcell.cell.cytoskeleton import Cytoskeleton

class Cytoplasm:

    @classmethod
    def isCytoskeletonProtein(cls, protein):
        return False
        

    def __init__(self):
        self.cytosol = Cytosol()
        self.cytoskeleton = Cytoskeleton()
        self.organelles = None

    def __str__(self):
        repr = "Cytosol(%s)" % str(self.cytosol)
        return repr
        
    def __repr__(self):
        repr = "Cytosol:\n"
        repr += "  " + "\n  ".join(self.cytosol.__repr__().splitlines())
        return repr
    
    def addProtein(self, protein):
        if Cytoplasm.isCytoskeletonProtein(protein):
            self.cytoskeleton.addProtein(protein)
        else:
            self.cytosol.addProtein(protein)
            
    def addRna(self, rna):
        self.cytosol.addRna(rna)
        
    def extractRandomRna(self):
        return self.cytosol.extractRandomRna()